
#include "relevant_information_widget.h"
#include <QDesktopServices>
#include <QUrl>

RelevantInformationWidget::RelevantInformationWidget(QWidget *parent) :
        QWidget(parent)
{
    ui.setupUi(this);
    ui.plainTextEdit->setReadOnly(true);
    ui.plainTextEdit->setContextMenuPolicy(Qt::ContextMenuPolicy::NoContextMenu);
}

RelevantInformationWidget::~RelevantInformationWidget()
{

}

void RelevantInformationWidget::on_btn_learning_view_clicked()
{
    QDesktopServices::openUrl(QUrl(QString("https://china.chipslightai.com/%e6%95%99%e5%ad%a6%e8%a7%86%e9%a2%91/")));
}

void RelevantInformationWidget::setTitle(const QString &title)
{
    ui.label_title->setText(title);
}

void RelevantInformationWidget::setContent(const QString &content)
{
    ui.plainTextEdit->setPlainText(content);
}
